<div class="container">
    <div class="d-flex align-items-center mb-3">
        <h4 class="mr-auto">Sustainable Products</h4>
        <!--         <app-company-report-download *ngIf="downloadData && productPermissions.productinvolvement && hasActiveInvolvedAssessments" [company]="company" [downloadData]="downloadData" [displayText]="'Report'" [analyticsData]="analyticsData" class="ml-auto"></app-company-report-download>
 -->
    </div>

    <div *ngIf="errorMessage" class="card p-2 mb-5">{{ errorMessage }}</div>

    <div *ngIf="assessments && !errorMessage">
        <h3 class="mb-4">Indicators</h3>
        <div class="row d-flex">
            <div *ngFor="let assessment of assessments" class="col-md-4 h-100">
                <div *ngIf="companyInvolvement" class="card product shadow" [ngClass]="{'pointer': (isInvolved(assessment) && (assessment.hasAccess)) }"
                    (click)="setSelectedAssessment(assessment);showDetails(assessment);">
                    <div class="card-body">
                        <div class="d-flex align-items-start">
                            <div class="d-flex align-items-center w-100 mr-auto">
                                <div class="w-25">
                                    <img [attr.src]="getAssessmentIcon(assessment)" class="product-involvement-icon" />
                                </div>
                                <div class="w-75 pl-3">
                                    <h5 class="mb-2">{{ assessment.name }}</h5>
                                    <span class="secondary-text" *ngIf="companyInvolvement">
                                        <span *ngIf="!assessment.hasAccess">Subscription Required</span>
                                        <span *ngIf="assessment.hasAccess && isNotResearched(assessment)">Not researched</span>
                                        <span *ngIf="assessment.hasAccess && !isNotResearched(assessment) && isInvolved(assessment)">Involvement</span>
                                        <span *ngIf="assessment.hasAccess && !isNotResearched(assessment) && !isInvolved(assessment)">No Involvement</span>
                                    </span>
                                </div>
                            </div>
                            <div class="w-10 ml-auto pl-2">
                                <i *ngIf="!assessment.hasAccess" class="ti-lock"></i>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<app-modal #sustainableProductsModal [id]="'sustainableProductsModal'" [size]="'modal-xl'">
    <div class="app-modal-header">
        Indicator Details
    </div>
    <div class="app-modal-body">
        <div *ngIf="selectedAssessment && categories" class="px-3">
            <div class="d-flex align-items-center">
                <img [attr.src]="getAssessmentIcon(selectedAssessment,'on')" class="product-involvement-icon" />
                <div class="pl-3">
                    <h4 class="mb-2">{{ selectedAssessment.name }}</h4>
                </div>
            </div>
            <div class="row pt-3"> {{getAssessmentDescription(selectedAssessment)}} </div>
            <div>
                <div class="row card-body pb-1">
                    <div class="col-5">
                        <h6> Category of Involvement</h6>
                    </div>
                    <div class="col-2">
                        <h6> Revenue Percentage</h6>
                    </div>
                    <div class="col-3">
                        <h6> Revenue Analysis Source</h6>
                    </div>
                    <div class="col-1">
                        <h6> Financial Year</h6>
                    </div>
                </div>
            </div>
            <sustainable-indicator *ngFor="let category of getCategoriesForAssessment(selectedAssessment)" [indicatorAssessments]="selectedAssessment.indicatorAssessments"
                [category]="category"></sustainable-indicator>
        </div>
    </div>
</app-modal>